const fname = '[activity-request-error]'

// 统一处理服务端请求报错
function resolveServerError (err) {
	console.error(fname, err)
	if (this.logger && err) {
		let msg = `${fname} name: ${err.name}\nmessage: ${err.message}\nstack:\n${err.stack}`
		this.logger.error(msg)
	}
	return {
		ret: -1,
		msg: err.message,
		data: null
	}
}

export default resolveServerError
